<template>
  <view class="good-list">
    <uni-list>
      <uni-list-item
        v-for="(item, index) in list"
        :key="index"
        clickable
        showArrow
        @click="navigateTo(item)"
      >
        <template slot="body">
          <view class="u-cell-group">
            <view class="u-cell-item">
              <u-tag :text="item.title" />
            </view>
            <view v-if="item.content" class="u-cell-item">
              <text class="title">{{$t('申请内容')}}:</text>
              <text class="desc">{{ item.content }}</text>
            </view>
            <view class="u-cell-item">
              <text class="title">{{$t('申请设备')}}:</text>
              <text class="desc">{{ item.deviceName }}</text>
            </view>
            <view class="u-cell-item">
              <text class="title">{{$t('申请用户')}}:</text>
              <text class="desc">{{ item.userName }}</text>
            </view>
            <view class="u-cell-item">
              <text class="title">{{$t('申请时间')}}:</text>
              <text class="desc">{{ item.createDate }}</text>
            </view>
          </view>
        </template>
      </uni-list-item>
    </uni-list>
  </view>
</template>

<script>
import { mapGetters, mapMutations } from 'vuex'

export default {
  computed: {
    ...mapGetters(['userInfo', 'api'])
  },
  props: {
    list: {
      type: [Array],
      default() {
        return []
      }
    }
  },
  data() {
    return {}
  },
  mounted() {
  },
  methods: {
    navigateTo(item) {
      uni.navigateTo({
        url: '../infoOcr/infoOcr?data=' + encodeURIComponent(JSON.stringify(item))
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.good-list {
  background-color: #fff;
  width: 100%;

  .u-cell-group {
    font-size: 28rpx;

    .u-cell-item {
      padding: 10rpx 0;
      box-sizing: border-box;
      z-index: 10;
      display: flex;
      position: relative;
      color: #888;

      .title {
        margin-right: 10rpx;
        font-weight: bold;
      }

      .desc {
        color: #888;
      }
    }

    .image-warp {
      position: absolute;
      right: 40rpx;
      top: 20%;
      z-index: 1;
    }
  }
}
</style>
